package com.crm.util;

import java.util.Date;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.crm.model.mpojo.SysDept;
import com.google.common.collect.Lists;


/**
 * 用于展示部门层级关系
 * 
 * @author 周远星
 *
 */
public class DeptLevelDto {
	private Integer id;

	private String label;

	private String level;

	private Integer seq;

	private String remark;

	private Integer parentid;

	private String operator;

	private Date operatetime;

	private String operatelp;

	private List<DeptLevelDto> children =  Lists.newArrayList();

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getLevel() {
		return level;
	}

	public void setLevel(String level) {
		this.level = level;
	}

	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Integer getParentid() {
		return parentid;
	}

	public void setParentid(Integer parentid) {
		this.parentid = parentid;
	}

	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		this.operator = operator;
	}

	public Date getOperatetime() {
		return operatetime;
	}

	public void setOperatetime(Date operatetime) {
		this.operatetime = operatetime;
	}

	public String getOperatelp() {
		return operatelp;
	}

	public void setOperatelp(String operatelp) {
		this.operatelp = operatelp;
	}

	
	public List<DeptLevelDto> getChildren() {
		return children;
	}

	public void setChildren(List<DeptLevelDto> children) {
		this.children = children;
	}
	
	@Override
	public String toString() {
		return "DeptLevelDto [id=" + id + ", label=" + label + ", level=" + level + ", seq=" + seq + ", remark="
				+ remark + ", parentid=" + parentid + ", operator=" + operator + ", operatetime=" + operatetime
				+ ", operatelp=" + operatelp + ", children=" + children + "]";
	}

	public static DeptLevelDto adept(SysDept dept) {
		DeptLevelDto dto = new DeptLevelDto();
		 BeanUtils.copyProperties(dept, dto);
		 dto.setLabel(dept.getName());
		System.out.println("是不是你的问题" + dto);
		return dto;

	}
}
